<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="layout" content="main" />
    <title>New persons to ${teamInstance.name} team selection</title>
  </head>
  <body>
    <div class="nav">
      <span class="menuButton"><a class="home" href="${resource(dir:'')}">Home</a></span>
      <span class="menuButton"><g:link class="list" action="list">Team List</g:link></span>
    </div>
    <div class="body">
      <h1>Select members to ${teamInstance.name} team</h1>

      <g:if test="${flash.message}">
        <div class="message">${flash.message}</div>
      </g:if>
      <g:form action="saveMembers" method="post" >
	<input type="hidden" name="teamId" value="${teamInstance.id}"/>
	<div class="list">
	  <table>
	    <thead>
	      <tr>
		<th class="sortable">Select</th>
		<g:sortableColumn property="id" title="Id" />              
		<g:sortableColumn property="name" title="Name" />
		<g:sortableColumn property="lastName" title="Last Name" />
		<g:sortableColumn property="telephone" title="Telephone" />
		<g:sortableColumn property="email" title="Email" />
		<g:sortableColumn property="birthday" title="Birthday" />
	      </tr>
	    </thead>
	    <tbody>
	      <g:each in="${personInstanceList}" status="i" var="personInstance">
		<tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
		  <td><g:checkBox name="person-${personInstance.id}" value="${false}" /></td>
		  <td><g:link action="show" id="${personInstance.id}">${fieldValue(bean:personInstance, field:'id')}</g:link></td>
		  <td>${fieldValue(bean:personInstance, field:'name')}</td>
		  <td>${fieldValue(bean:personInstance, field:'lastName')}</td>
		  <td>${fieldValue(bean:personInstance, field:'telephone')}</td>
		  <td>${fieldValue(bean:personInstance, field:'email')}</td>
		  <td>${g.format(date:personInstance.birthday)}</td>
		</tr>
	      </g:each>
	    </tbody>	    
	  </table>
	</div>
	<div class="buttons">
          <span class="button"><input class="save" type="submit" value="Save" /></span>
	</div>
      </g:form>

      <div class="paginateButtons">
        <g:paginate total="${personInstanceTotal}" />
      </div>
    </div>
  </body>
</html>
